package com.icart.entities;

import org.springframework.context.annotation.Primary;

import javax.persistence.*;

@Entity
@Table(name = "wo_commentitem", schema = "ams", catalog = "")
@IdClass(WoCommentitemEntityPK.class)
public class WoCommentitemEntity {
    private long commid;
    private int itemid;
    private String oid;
    private Long objid;
    private Integer commstar;
    private String commcontent;

    @Id
    @Column(name = "commid")
    public long getCommid() {
        return commid;
    }

    public void setCommid(long commid) {
        this.commid = commid;
    }

    @Id
    @Column(name = "itemid")
    public int getItemid() {
        return itemid;
    }

    public void setItemid(int itemid) {
        this.itemid = itemid;
    }

    @Basic
    @Column(name = "oid")
    public String getOid() {
        return oid;
    }

    public void setOid(String oid) {
        this.oid = oid;
    }

    @Basic
    @Column(name = "objid")
    public Long getObjid() {
        return objid;
    }

    public void setObjid(Long objid) {
        this.objid = objid;
    }

    @Basic
    @Column(name = "commstar")
    public Integer getCommstar() {
        return commstar;
    }

    public void setCommstar(Integer commstar) {
        this.commstar = commstar;
    }

    @Basic
    @Column(name = "commcontent")
    public String getCommcontent() {
        return commcontent;
    }

    public void setCommcontent(String commcontent) {
        this.commcontent = commcontent;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        WoCommentitemEntity that = (WoCommentitemEntity) o;

        if (commid != that.commid) return false;
        if (itemid != that.itemid) return false;
        if (oid != null ? !oid.equals(that.oid) : that.oid != null) return false;
        if (objid != null ? !objid.equals(that.objid) : that.objid != null) return false;
        if (commstar != null ? !commstar.equals(that.commstar) : that.commstar != null) return false;
        if (commcontent != null ? !commcontent.equals(that.commcontent) : that.commcontent != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = (int) (commid ^ (commid >>> 32));
        result = 31 * result + itemid;
        result = 31 * result + (oid != null ? oid.hashCode() : 0);
        result = 31 * result + (objid != null ? objid.hashCode() : 0);
        result = 31 * result + (commstar != null ? commstar.hashCode() : 0);
        result = 31 * result + (commcontent != null ? commcontent.hashCode() : 0);
        return result;
    }
}
